<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('服务对话列列表')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>开始时间：</label>
                                <input type="text" class="form-control" name="startTime" id="startTime"
                                       placeholder="开始时间" />
                            </li>
                            <li>
                                <label>结束时间：</label>
                                <input type="text" class="form-control" name="endTime" id="endTime"
                                       placeholder="开始时间" />
                            </li>


                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;筛选</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>


            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: datetimepicker-js" />
     <script type="text/javascript">
         layui.use('laydate',function(){
             layui.laydate.render({
                 elem:'#startTime',
                 theme:'molv',
                 trigger:'click',
                 type:'datetime'
             })
         });

         layui.use('laydate',function(){
             layui.laydate.render({
                 elem:'#endTime',
                 theme:'molv',
                 trigger:'click',
                 type:'datetime'
             })
         });

     </script>
    <script th:inline="javascript">
        var datas = [[${@dict.getType('sys_user_kf')}]];
        var editFlag = [[${@permission.hasPermi('system:service:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:service:remove')}]];
        var prefix = ctx + "system/service";

        $(function() {
            var options = {
                url: prefix + "/listmyd",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "服务对话列",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'serviceId',
                    title: '服务会话Id',
                    visible: false
                },
                {
                    field: 'beginTime',
                    title: '开始时间'
                },
                {
                    field: 'endTime',
                    title: '结束时间'
                },
                {
                    field: 'fromnum',
                    title: '客户电话'
                },
                {
                    field: 'serviceType',
                    title: ' 类型',
                    formatter: function(value, row, index) {
                        if (value = '6'){
                            return '语音电话'
                        }
                        if (value = '5'){
                            return 'IM'
                        }
                    }
                },
                {
                    field: 'agentid',
                    title: '坐席客服',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabels(datas, value);
                    }
                },
                {
                    field: 'satisfaction',
                    title: '满意度',
                    formatter: function(value, row, index) {
                         if (row.satisfaction = '2'){
                             return '满意'
                         }

                        if (row.satisfaction = '3'){
                            return '一般'
                        }

                        if (row.satisfaction = '5'){
                            return '不满意'
                        }
                    }




                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>